package com.hwl.cms.controller;


import com.hwl.cms.service.AdService;
import com.hwl.commonutils.result.RespBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 广告推荐 前端控制器
 * </p>
 *
 * @author long
 * @since 2021-10-06
 */
@Api(tags = "广告推荐")
@RestController
@RequestMapping("/api/cms/ad")
public class ApiAdController {

    @Resource
    private AdService adService;

    @ApiOperation("根据推荐位获取广告")
    @GetMapping("list/{adTypeId}")
    public RespBean listByAdTypeId(@PathVariable String adTypeId) {
        return RespBean.ok().data(adService.selectByAdTypeId(adTypeId));
    }

}

